<?php
require_once 'application/library/controller/gcErrorAction.php';

/** 
 * ErrorController
 * @author    Soochow University
 * @version   1.0
 * @exclude   作  成  日：2011/04/07
 */
class ErrorController extends gcErrorAction{
    
    /**
     * errorAction
     */
    public function errorAction(){
        //print_r($this->getRequest()->getParams());
        
        $errors = $this->_getParam("error_handler");
        
        /*switch ($errors->type) {
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
        
                // 404 error -- controller or action not found
                $this->getResponse()->setHttpResponseCode(404);
                $this->view->message = 'Page not found';
                break;
            default:
                // application error
                $this->getResponse()->setHttpResponseCode(500);
                $this->view->message = 'Application error';
                break;
        }
        */
        echo $errors->exception;
        //echo $errors->request;
    }
    
    /**
     * ajaxAction
     */
    public function ajaxAction(){
        $textStatus = $this->getRequest()->getParam("textStatus");
        $errorThrown = $this->getRequest()->getParam("errorThrown");
        echo $textStatus;
        echo "<br>";
        echo $errorThrown;
    }
}

